function LD=mydet(x);
%function LD=mydet(x); 
%Computes Log of the determinant of symmetric positive definite matrix x 
%Use to avoid numerical problems when the determinant may be 
%very close to zero 
%AJ 10/26/03 
% Tested
[ss,vv,dd]=svd(x); 
LD=sum(log(diag(vv))); 
